<%@page import="com.ilibrary.web.vo.NewsVO"%>
<%@page import="com.ilibrary.constants.MyConstants"%>
<%@page import="com.ilibrary.web.vo.UserInfoVO"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>新闻详情</title>
<%@include file="../_common.jsp" %>
<link href="<%=request.getContextPath()%>/template_css/index/index.css" rel="stylesheet" type="text/css">
<link type="text/css" rel="stylesheet" href="<%=request.getContextPath()%>/template_css/search/base.css">
<link type="text/css" rel="stylesheet" href="<%=request.getContextPath()%>/template_css/search/main.css">
</head>

<%
	UserInfoVO loginUser = (UserInfoVO)request.getSession().getAttribute(MyConstants.ILIBRARY_lOGIN_USER);
	NewsVO newsVO = (NewsVO)request.getAttribute("newsVO");
%>

<body>
	<div class="warp">
		<div class="head_index">
			<span class="logo">
				<img src="<%=request.getContextPath() %>/template_images/index/logo_3.png">
			</span>
			<form id="clientLoginForm" action="<%=request.getContextPath() %>/doLogin.action" method="post">
			<span class="note">
				<p style="text-align: right;">
					<a href="javascript: void(0)" target="_blank">
						<img src="<%=request.getContextPath() %>/template_images/index/lg.gif" align="absmiddle">
					</a>
				</p>
				<%
				if(loginUser == null) {
				%>
				<p style="text-align: right;">
					<span id="loginm">
						学工号 <span id="usnm">
								<input name="userId" id="userId" onkeypress="huiche(event,6)" type="text">
							</span>
						密码 <span id="pswd">
								<input name="userPassword" id="userPassword" onkeypress="huiche(event,6)" type="password">
							</span>
							<input name="userType" value="<%=MyConstants.ILIBRARY_LOGIN_TYPE_STU%>" type="hidden">
							<span id="loginss" onclick="check_user()">&nbsp;</span>
					</span>
				</p>
				<%
				} else {
				%>
				<p style="text-align: right;">
					<span> 
						欢迎您： <span><a href="<%=request.getContextPath() %>/client/userCenter.action"><%=loginUser.getUserName() %></a>&nbsp;&nbsp;<a onclick="doLogout()" href="javascript: void(0)">退出</a></span> 
					</span>
				</p>
				<%
				}
				%>
			</span>
			</form>
		</div>
	</div>
	<div style="border: 1px solid #CCC;margin-top: 5px;width: 960px;height: auto;overflow: hidden;background-color: #F0F4FB;">
		<div style="margin-left: 30px;width: 900px;height: auto;overflow: hidden;">
			<%
				if(newsVO == null) {
			%>
				<div style="text-align: center;line-height: 300px;font-size: 20px;font-weight: bold;">
					对不起,你查询的新闻不存在!请重试!
				</div>
			<%
				}else {
			%>
				<div style="float: left;text-align: center;width: 890px;font-size: 16px;font-weight: bold;height: 40px;line-height: 40px;">
					<%=newsVO.getNewsTitle() %>
				</div>
				<div style="float: left;text-align: right;width: 890px;font-size: 12px;font-weight: bold;height: 20px;line-height: 20px;border-bottom: 1px solid #CCC;">
					来自：<%=newsVO.getNewsCategoryName() %>&nbsp;&nbsp;&nbsp;&nbsp;<%=newsVO.getCreateDt().toLocaleString() %>
				</div>
				<div style="float: left;width: 890px;font-size: 14px;height: auto;overflow: hidden;padding: 10px;margin-bottom: 50px;line-height: 25px;">
					&nbsp;&nbsp;&nbsp;&nbsp;<%=newsVO.getNewsContent() %>
				</div>
			<%
				}
			%>
		</div>
	</div>
	<div class="foot_index" style="margin-top: 20px;clear: both;">
		<p>航空港校区：成都市双流县西南航空港经济开发区 学府路一段24号 邮编：610225</p>
		<p>
			Copyright 2013 Chengdu University Of Information Technology Library. All Right Reserved 
		</p>
		<p>&nbsp;</p>
	</div>
</body>

<script type="text/javascript">

	function check_user() {
		var userId = $('#userId').val();
		var userPassword = $('#userPassword').val();
		if(userId == null || userId == '') {
			alert("请输入有效登录学号！");
			$('userId').focus();
			return false;
		}
		if(userPassword == null || userPassword == '') {
			alert("请输入有效登录密码！");
			$('userPassword').focus();
			return false;
		}
		$('#clientLoginForm').submit();
	}
	
</script>

</html>